<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <title>添加教师</title>
    <link rel="stylesheet" href="css/pintuer.css">
    <link rel="stylesheet" href="css/admin.css">
    <script src="js/jquery.js"></script>
    <script src="js/pintuer.js"></script>
    <script type="text/javascript">
        $(function () {
            // 1.下拉选择部门信息
            $.post("/sms/offlineSchool/departmentServlet.do", "method=findDropDownToSelectAllDepartment", function (res) {
                $.each(res, function (i, e) {
                    $("#sel").append("<option value='" + e.id + "'>" + e.name + "</option>")
                })
            }, "json")

            // 2.点击提交按钮
            $("#btn").click(function () {
                // 发送ajax请求
                $.post("/sms/offlineSchool/teacherServlet.do", $("form").serialize() + "&method=saveOneTeacherInfo", function (res) {
                    if (res == 1) {
                        alert("添加成功! ")
                    } else {
                        alert("添加失败！")
                    }
                })
            })
        })
    </script>
</head>
<body>
<div class="panel admin-panel">
    <div class="panel-head"><strong><span class="icon-pencil-square-o"></span>添加教师</strong></div>
    <div class="body-content">
        <form method="post" class="form-x" action="">
            <div class="form-group">
                <div class="label">
                    <label>姓名：</label>
                </div>
                <div class="field">
                    <input type="text" class="input" name="teacherName" value="" style="width:30%"/>
                    <div class="tips"></div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>性别：</label>
                </div>
                <div class="field" style="padding-top:8px;">
                    男: <input type="radio" name="sex" value=""/>
                    女: <input type="radio" name="sex" value=""/>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>爱好：</label>
                </div>
                <div class="field" style="padding-top:8px;">
                    滑雪 <input type="checkbox" name="hobby" value="滑雪"/>
                    羽毛球 <input type="checkbox" name="hobby" value="羽毛球"/>
                    冰壶 <input type="checkbox" name="hobby" value="冰壶"/>
                </div>
            </div>


            <div class="form-group">
                <div class="label">
                    <label>出生年月：</label>
                </div>
                <div class="field">
                    <input type="date" class="input" name="birthDate" value="" style="width:30%"/>
                    <div class="tips"></div>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>手机号：</label>
                </div>
                <div class="field">
                    <input type="text" class="input" name="phone" value="" style="width:30%"/>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label>所在部门：</label>
                </div>
                <div class="field">
                    <select class="input" style="width:30%" id="sel" name="did">
                        <option>--请选择--</option>
                    </select>
                </div>
            </div>


            <div class="form-group">
                <div class="label">
                    <label>描述：</label>
                </div>
                <div class="field">
                    <textarea type="text" class="input" name="teacherDesc" style="height:80px;"></textarea>
                </div>
            </div>


            <div class="form-group">
                <div class="label">
                    <label></label>
                </div>
                <div class="field">
                    <button class="button bg-main icon-check-square-o" type="button" id="btn"> 提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
</body>
</html>